package site.beanyon.now.constant;

/**
 * http状态枚举类
 */
public enum ResponseEnum {
    SUCCESS(true, 1001, "操作成功"),

    NOT_SIGN_IN(false, 2001, "尚未登录，登录一下吧"),
    SUCCESS_SIGN_IN(true, 2002, "登录成功"),
    FAILED_SIGN_IN(false, 2003, "登录失败"),
    SUCCESS_SIGN_UP(true, 2004, "注册成功"),
    FAILED_SIGN_UP(false, 2005, "注册失败"),
    ACCOUNT_NOT_EXISTS(false, 2006, "账号不存在"),
    PASSWORD_INCORRECT(false, 2007, "密码错误"),

    DATA_DUPLICATE(false, 3001, "数据违反唯一约束"),
    DATA_TOO_LONG(false, 3002, "数据超出长度限制"),

    SUCCESS_UPDATE_USER_INFO(true, 7001, "用户信息修改成功"),
    FAILED_UPDATE_USER_INFO(false, 7002, "用户信息修改失败"),

    SUCCESS_CREATE_TIME_CARD(true, 8001, "时间卡片创建成功"),
    FAILED_CREATE_TIME_CARD(false, 8002, "时间卡片创建失败"),
    SUCCESS_CREATE_TIME_SPAN(true, 8003, "时间区间创建成功"),
    FAILED_CREATE_TIME_SPAN(false, 8004, "时间区间创建失败"),
    SUCCESS_DELETE_TIME_CARD(true, 8005, "时间卡片删除成功"),
    FAILED_DELETE_TIME_CARD(false, 8006, "时间卡片删除失败"),
    ACTIVITY_IS_NULL(false, 8007, "请输入活动名称"),
    ACTIVITY_EXISTS(false, 8008, "此活动名称已经存在，请重新输入"),
    SUCCESS_UPDATE_ACTIVITY(true, 8009, "活动名称更新成功"),
    FAILED_UPDATE_ACTIVITY(true, 8010, "活动名称更新失败"),
    SUCCESS_UPDATE_TIME(true, 8011, "时间更新成功"),
    FAILED_UPDATE_TIME(false, 8012, "时间更新失败"),
    SUCCESS_CREATE_TIME_PLAN(true, 8013, "时间计划创建成功"),
    FAILED_CREATE_TIME_PLAN(false, 8014, "时间计划创建失败"),
    SUCCESS_DELETE_TIME_PLAN(true, 8015, "时间计划删除成功"),
    FAILED_DELETE_TIME_PLAN(false, 8016, "时间计划删除失败"),
    SUCCESS_UPDATE_TIME_PLAN(true, 8015, "时间计划更新成功"),
    FAILED_UPDATE_TIME_PLAN(false, 8016, "时间计划更新失败"),
    TIME_PLAN_ID_IS_NULL(false, 8017, "时间计划的id为空"),

    FAILED(true, 9001, "操作失败"),
    REQUIRED_PARAM_NOT_EXISTS(false, 9002, "必要参数为空"),
    UNKNOWN(false, 9999, "出现未知错误，操作失败");

    /**
     * 处理结果
     */
    private Boolean result;

    /**
     * 状态码
     */
    private Integer code;

    /**
     * 状态消息
     */
    private String message;

    ResponseEnum(Boolean result, Integer code, String message) {
        this.result = result;
        this.code = code;
        this.message = message;
    }

    public Boolean getResult() {
        return result;
    }

    public void setResult(Boolean result) {
        this.result = result;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }
}
